package com.medical.manage.controller;

import com.medical.common.core.domain.Result;
import com.medical.common.core.web.controller.BaseController;
import com.medical.common.core.web.page.TableDataInfo;
import com.medical.manage.domain.DepartmentManagement;
import com.medical.manage.domain.HospitalManagementTable;
import com.medical.manage.domain.PatientInformation;
import com.medical.manage.service.HospitalManagementTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HospitalManagementTableController extends BaseController {
    @Autowired
    HospitalManagementTableService hospitalManagementTableService;

    /**
     * 医院列表
     * @param hospitalManagementTable
     * @return
     */
    @GetMapping("/list")
    public Result<TableDataInfo> list(HospitalManagementTable hospitalManagementTable){
        startPage();
        List<HospitalManagementTable> list=hospitalManagementTableService.selectHospitalManagementTableList(hospitalManagementTable);
        return getDataTable(list);
    }

    /**
     * 科室列表
     * @param hospitalId
     * @return
     */
    @GetMapping("/departmentList/{hospitalId}")
    public Result departmentList(@PathVariable("hospitalId") Long hospitalId){
        return success(hospitalManagementTableService.departmentList(hospitalId));
    }

    /**
     * 医师级别列表
     * @param departmentId
     * @return
     */
    @GetMapping("/physicianList/{departmentId}")
    public Result physicianList(@PathVariable("departmentId") Long departmentId){

        return success(hospitalManagementTableService.physicianList(departmentId));
    }

    /**
     * 医师列表
     * @param rankOfPhysician
     * @return
     */
    @GetMapping("/medic/{rankOfPhysician}")
    public Result medic(@PathVariable("rankOfPhysician") Long rankOfPhysician){
        return success(hospitalManagementTableService.medicList(rankOfPhysician));
    }

    /**
     * 医生详情列表
     * @param doctorId
     * @return
     */
    @GetMapping("/medicList/{doctorId}")
    public Result medicList(@PathVariable("doctorId") Long doctorId){
        return success(hospitalManagementTableService.medList(doctorId));
    }

    /**
     * 诊断报告
     * @param patientName
     * @return
     */
    @GetMapping("/medical/{patientName}")
    private Result<List<PatientInformation>> patientList(@PathVariable("patientName")String patientName){
        return success(hospitalManagementTableService.patientList(patientName));
    }




}
